import java.util.Scanner;

public class Test {
    //求一个整数，在内存当中存储时，二进制1的个数。
    public static void main(String[] args) {
        Scanner scanner=new Scanner(System.in);
        int a=scanner.nextInt();
        int count=0;
        while(a!=0){
            a=a&(a-1);
            count++;
        }
        System.out.println(count);
    }
    //给定两个数，求这两个数的最大公约数
    public static void main6(String[] args) {
        Scanner scanner=new Scanner(System.in);
        int a=scanner.nextInt();
        int b=scanner.nextInt();
        int c=0;
        c=a%b;
        while(c!=0){
            a=b;
            b=c;
            c=a%b;
        }
        System.out.println(b);
    }
    //计算1/1-1/2+1/3-1/4+1/5 …… + 1/99 - 1/100 的值
    public static void main5(String[] args) {
        double sum=0;
        int flag=1;
        for(int i=1;i<=100;i++){
            sum+=1.0/i*flag;
            flag=-flag;
        }
        System.out.println(sum);
    }
    public static void main4(String[] args) {
        Scanner scanner=new Scanner(System.in);
        int n=scanner.nextInt();
        for(int i=1;i<=n;i++){
            int count=0;
            int j=i;
            while(j!=0){
                count++;
                j/=10;
            }
            int tep=i;
            int sum=0;
            while(count!=0){
                int a=tep%10;
                sum+=(a*a*a);
                tep/=10;
                count--;
            }
            if(sum==i){
                System.out.print(i+" ");
            }
        }
    }
        public static void main3(String[] args) {

            Scanner scanner = new Scanner(System.in);

            while (scanner.hasNextInt()) {
                int n = scanner.nextInt();
                for (int i = 0; i < n; i++) {
                    for (int j = 0; j < n; j++) {
                        if (i == j || i + j == n - 1) {
                            System.out.print("*");
                        }else {
                            System.out.print(" ");
                        }
                    }
                    System.out.print("\n");
                }
            }

        }
    //判断一个数是否为素数
    public static void main2(String[] args) {
        Scanner scanner=new Scanner(System.in);
        int n=scanner.nextInt();
        int flag=0;
        for(int i=2;i<n;i++){
            flag=1;
            if(n%i==0){
                System.out.println(n+"不是素数");
                flag=-1;
                break;
            }
           else{
               flag=1;
            }
        }
        if(flag==1){
            System.out.println(n+"是素数");
        }

    }



    //打印1到100中4出现的次数
    public static void main1(String[] args) {
        int i=0;
        int j=0;
        int count=0;
        for(i=1;i<=100;i++){
            j=i;
            while(j!=0) {
                int number=j%10;
                if (number==4){
                    count++;
                }
                j/=10;
            }
        }
        System.out.println("1到100中出现4的次数为"+count+"个");
    }
}
